/*
 * Information about a TV Show
 */
package tardistv.model;

import java.util.ArrayList;

/**
 *
 * @author Tardis TV Team
 */
public class Show {

    private String _name;
    private String _code;
    private int _id;
    private ArrayList<Episode> episodes;

    public Show(){
        episodes=new ArrayList<Episode>();
    }

    public void addEpisode(Episode episodeToAdd) {
        for (Episode episode : episodes) {
            if (episode.getNumber().compareTo(episodeToAdd.getNumber()) == 0) {
                return;
            }
        }
        episodes.add(episodeToAdd);
    }

    public ArrayList<Episode> getEpisodes() {
        return episodes;
    }

    public int getId() {
        return _id;
    }

    public void setId(int _id) {
        this._id = _id;
    }

    public String getCode() {
        return _code;
    }

    public void setCode(String _code) {
        this._code = _code;
    }

    public String getName() {
        return _name;
    }

    public void setName(String _name) {
        this._name = _name;
    }

    @Override
    public String toString() {
        return _name;
    }
}
